PageSpinner Includes


Syntax of PageSpinner Include Comments

Include types

Including Date and Time Stamps

Including Files

Including Notebook Pages

Back to Index Page

Including Date and Time Stamps

It is possible to have the day and time automatically inserted in your file like this:

Last updated: Monday, June 2, 1997, 6:20 PM

To get the date and time above updated when you save, the following comment pairs needs to be in the HTML file:

<!-- ps_include date="long" --><!-- /ps_include -->,
<!-- ps_include time="" --><!-- /ps_include -->

Date syntax:

<!-- ps_include date="format" --> <!-- /ps_include -->

where format can be one of the following:

  • long
  • abbrev
  • short

The date keyword and format values can be in either upper case or lower case.

The settings in the system's Date and Time control panel defines country specific separators and the long and short names of months and days.

Time syntax:

<!-- ps_include time="format" --> <!-- /ps_include -->

where format can be empty, or contain the text secs if seconds should be included.

The time keyword and format value are case insensitive.

The settings in the system's Date and Time control panel defines country specific separators.


Including Files

It is possible to have the contents from a text file inserted in your file like this:


Send comments to the Webmaster

This enables you to keep frequently used text and formatting in one place. When you need to edit the information you will only have to change the contents in one place, and resave all files that contains the included file to get those files updated.

Using include files makes it possible to change the look of a site without the tedious work of manually editing every single page. See below on how include files could contain standard headers and footers that are to be used on all pages in a site.

To get the contents from the file included every time you save, the following comment pairs needs to be in the HTML file. As you can see, the contents from the file "address.incl" is inserted between the start and end comment.

<!-- ps_include file="address.incl" --> <HR> Send comments to the <A HREF="mailto:webmaster@our.site.edu">Webmaster</A> <HR> <!-- /ps_include file="address.incl" -->
File syntax:

<!-- ps_include file="file_name" --><!-- /ps_include file="file_name" -->

where file_name is the name of the file.

The file keyword is case insensitive, the file name is case sensitive.

The file must be placed in the folder named "Includes". This folder can be placed:
- in the same folder as the file
- in a folder above the current file's folder
- in the global include folder inside the same folder as the PageSpinner application

Note that the text file="file_name" also must be included in the end comment. This enables you to have other include comments inside include files; an include file can thereby include other include files.

It is recommended to end the name of include files with .incl to separate these from standard HTML files. The files can contain any text and HTML tags.

Recommended usage:
Include files can be used to keep the headers and footers of the pages in a site in separate include files to maintain a consistent and easily editable look of the site.

Also note that it is possible to have the start BODY tag inside an include file to make it easy to change the colors and background image of several pages in a site. This will then be easily done just by changing the contents in the include file and resaving the files that contains the included "body start tag" file. Take a look at the source of this file too see how it uses the file named "header.incl" that contains the start BODY tag.

Remember that you are not restricted to just use includes for headers and footers, any part of page can be an include, here is a few examples:
- a navigation bar
- a part of a table, such as a cell, that contains navigational links
- a link back to the home page
- a logotype or image that you may want to change later

Search path for Include files:
This is how PageSpinner search for an include file:
First it looks for a file inside a folder named Include located in the same folder as the current file. If the file isn't found it searches for an Include folder in a folder above the current file. The search looks in up to 4 folder levels above the current folder.

If the file still isn't found, PageSpinner looks for it in the Include folder inside the same folder as the PageSpinner application. If no file with the given name is found PageSpinner reports an error.

This method of searching for an include file, enables you to maintain an hierarchic structure of the site's include files that enables easy updates of different sections of a site.

Before you upload the contents of a site kept on your local disk to a Web server you have to create the folder on the FTP server. Note that there is no need to upload any of the Include folders or to create an Include folder on the server, since the Include files are only used by PageSpinner when a file is saved.
Important: You should save the include files using the character set Mac TEXT and place these in the "Includes" folder. Use the command Set Filing Options... in PageSpinner to set the character set when you create an include file, if this isn't the default character set for new pages. Another way is to duplicate one of the sample include files when creating a new include file, since these are already set to use the Mac TEXT character set.

The AppleScript Save Selection as Include... in the Script menu will do this automatically.


Including Notebook Pages

It is possible to have the contents from a Notebook page inserted in your file like this:


Send comments to the Webmaster

Like include files, this option enables you to keep frequently used text and formatting in one place, and when you need to edit the information you only have to change the contents in one place, and resave all files that contains the included file to get those files updated.

Including Notebook pages makes it possible to change the look of a site without the tedious work of manually editing every single page. See below on how Notebook pages could contain a standard header and footer that are to be used on all pages in a site.

To get the contents from a page included every time you save, the following comment pairs needs to be in the HTML file. The contents from the Notebook page named "Address" is inserted between the start and end comment.

<!-- ps_include nb="Address" -->
<HR>
Send comments to the <A HREF="mailto:webmaster@our.site.edu">Webmaster</A>
<HR>
<!-- /ps_include nb="Address" -->

Notebook syntax:

<!-- ps_include nb="page_name" --> ... <!-- /ps_include nb="page_name" -->

where page_name is the name of the Notebook page.

The nb keyword is case insensitive, the page name is case sensitive.

Note that the text nb="page_name" also must be included in the end comment. This enables you to have other include comments inside include pages and files; an include page/file can thereby include other include pages/files.

It is recommended to reserve a range of the Notebook pages that will contain include text. The pages can contain any text and HTML tags.

A useful way of using include pages is to keep the headers and footers of the pages in a site in separate Notebook pages to maintain a consistent and easily editable look of the site.

Back to Index Page

Last updated: 6:20 PM , 6/2/97
© 1995-1997 Jerry ≈man.